package Demo1;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 34255
 * Date: 2024-06-10
 * Time: 15:23
 */
public class Test {
    public static void main(String[] args) {
        MyArray<Integer> integerMyArray = new MyArray<>();
    }
    public static void main3(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        switch(str){
            case "one" -> System.out.println("0");
            case "two" -> System.out.println("1");
            case "three" -> System.out.println("2");
            default -> System.out.println("3");
        };
    }
    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        int num = switch(str){
            case "one" : yield 1;
            case "two" : yield 2;
            case "three": yield 3;
            default:yield 4;
        };
        System.out.println("这个数字是：" + num);
    }

    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        int num = 0;
        switch(str){
            case "one":
                num = 1;
                break;
            case "two":
                num = 2;
                break;
            case "three":
                num = 3;
                break;
            default :
                num = 4;
                break;
        }
        System.out.println("这个数字是：" + num);
    }
}
